Adc self-test using time base and current source

ABSTRACT

A constant current source, a stable time base and a capacitor are used to self-check operation of an analog-to-digital convertor (ADC) by charging the capacitor for a pre-determined amount of time to produce a voltage thereon. This voltage will be proportional to the amount of time that the capacitor was charged. Multiple points on the ADC transfer function can be verified in this self-check procedure simply by varying the amount of time for charging of the capacitor. Relative accuracy among test points may then be easily obtained. Absolute accuracy may be obtained by using an accurate clock reference for the time base, a known current source and capacitor value.

RELATED PATENT APPLICATION

This application claims priority to commonly owned U.S. ProvisionalPatent Application Ser. No. 62/580,549; filed Nov. 2, 2017; entitled“ADC Self-Test Using Time Base and Current,” by James E. Bartling andStephen Bowling, and is hereby incorporated by reference herein for allpurposes.

TECHNICAL FIELD

The present disclosure relates to analog-to-digital (ADC) convertersand, more particularly, to an ADC self-test using a time base and acurrent source.

BACKGROUND

Functional safety of systems requires verification of equipment used formonitoring those systems. Monitoring equipment typically is digitallybased, e.g., microcontrollers and microprocessors, but monitor analogparameters. This requires analog-to-digital conversion which typicallyis performed with an analog-to-digital converter (ADC). However, it isimportant that functional testing of the ADC be performed in the analogdomain, e.g., analog inputs produce the correct digital outputs from theADC. Also, the linearity of the ADC should be verified during thefunctional testing thereof. Thus, multiple voltage points may be used toconfirm correct ADC transfer function. Verification of correct digitaloutputs from known reference voltages are desired.

FIG. 2 illustrations a prior technology schematic block diagram andgraph for ADC self-testing using external voltage references. This isboth complex and expensive since a number of voltage references,operational amplifiers and multiplexers must be used. Care must be takenin ensuring that the voltage references stay calibrated and themultiplexer switching does not distort or affect values of the voltagereferences.

SUMMARY

Therefore, what is needed is an accurate, fast, reliable and low-costway of generating test voltages for verifying operation of an ADC.

According to an embodiment, a method for self-testing ananalog-to-digital converter (ADC) may comprise the steps of: coupling aconstant current source to a discharged capacitor for a time period;converting a voltage on the capacitor after the time period to a digitalvalue with the ADC; and comparing the digital value from the ADC to thevoltage on the capacitor represented by the equation V=I/C*t, where Vmay be the voltage on the capacitor, I may be the constant current, Cmay be the capacitance of the capacitor and t may be the time period.

According to a further embodiment of the method, may comprise the stepsof: a) setting the time period to a minimum time; b) discharging thecapacitor; c) coupling the capacitor for the time period to the constantcurrent source having a current value I; d) converting the voltage onthe capacitor to a digital value with the ADC after the time periodends; e) storing the digital value of that time period in a memory; f)ending the testing of the ADC when the time period may be equal to orgreater than a maximum time then going to step i); g) increasing thetime period to a longer time; h) returning to step b); and i)determining ADC accuracy by evaluating the stored digital values.

According to a further embodiment of the method, the step of determiningADC linearity may comprise the steps of comparing the stored digitalvalues with the respective time periods multiplied by the current valueI and divided by a capacitance C of the capacitor. According to afurther embodiment of the method, may comprise the step of evaluatingthe stored digital values to determine ADC linearity.

According to a further embodiment of the method, may comprise the stepsof: a) setting the time period to a maximum time; b) discharging thecapacitor; c) coupling the capacitor for the time period to the constantcurrent source having a current value I; d) converting the voltage onthe capacitor to a digital value with the ADC after the time periodends; e) storing the digital value of that time period in a memory; f)ending the testing of the ADC when the time period may be less than orequal to a minimum time then going to step i); g) decreasing the timeperiod to a shorter time; h) returning to step b); and i) determiningADC accuracy by evaluating the stored digital values.

According to a further embodiment of the method, the step of determiningADC accuracy may comprise the steps of comparing the stored digitalvalues with the respective time periods multiplied by the current valueI and divided by a capacitance C of the capacitor. According to afurther embodiment of the method, may comprise the step of evaluatingthe stored digital values to determine ADC linearity.

According to another embodiment, an apparatus to self-test ananalog-to-digital converter (ADC) may comprise: a constant currentsource; a capacitor; a first switch operable to short out a charge onthe capacitor; a second switch operable to couple the constant currentsource to the capacitor; an ADC having an input coupled to thecapacitor; and a control circuit having a timer; wherein the controlcircuit may close the first switch thereby shorting out any charge onthe capacitor, may open the first switch and close the second switchthereby coupling the constant current source to the capacitor, and mayopen the second switch after a time period determined by the timer; anda memory for storing a digital representation from an output of the ADCof a voltage on the capacitor after the second switch opens.

According to a further embodiment, the memory may store a plurality ofdigital representations of respective voltages on the capacitorgenerated by a plurality of different time periods. According to afurther embodiment, the second switch may be a tri-state output of theconstant current source. According to a further embodiment, the timermay be programmable for generating different time periods. According toa further embodiment, a high accuracy clock may be coupled to the timerfor generating a precision time period.

According to yet another embodiment, a system for self-testing ananalog-to-digital converter (ADC) may comprise: a clock; a controlcircuit having a timer and coupled to the clock; a microprocessorcoupled to the control circuit; a memory coupled to the microprocessor;a constant current source; a capacitor; a first switch controlled by thecontrol circuit and operable to short out a charge on the capacitor; asecond switch controlled by the control circuit and operable to couplethe constant current source to the capacitor; and an ADC having an inputcoupled to the capacitor and an output coupled to the microprocessor;wherein the control circuit may close the first switch thereby shortingout any charge on the capacitor, may open the first switch and may closethe second switch thereby coupling the constant current source to thecapacitor, and may open the second switch after a time period determinedby the timer; and the microprocessor may store in the memory a digitalrepresentation from the ADC of a voltage on the capacitor after thesecond switch opens.

According to a further embodiment, the second switch may be a tri-stateoutput of the constant current source. According to a furtherembodiment, the system may comprise a microcontroller. According to afurther embodiment, the timer may be programmable for generatingdifferent time periods. According to a further embodiment, the clock maybe a high accuracy clock for generating a precision time period.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete understanding of the present disclosure may be acquiredby referring to the following description taken in conjunction with theaccompanying drawings wherein:

FIG. 1 illustrations a schematic block diagram for ADC self-test withoutuse of external references, according to embodiments of the presentdisclosure; and

FIG. 2 illustrations a prior technology schematic block diagram andgraph for ADC self-testing using external voltage references.

While the present disclosure is susceptible to various modifications andalternative forms, specific example embodiments thereof have been shownin the drawings and are herein described in detail. It should beunderstood, however, that the description herein of specific exampleembodiments is not intended to limit the disclosure to the formsdisclosed herein.

DETAILED DESCRIPTION

Example aspects of the present disclosure are described below inconjunction with FIG. 1, which shows a simple, low cost circuit for ADCself-test without the use of external voltage references. Embodiments ofthe present disclosure are directed to self-checking an ADC against morethan one voltage reference for functional safety of the circuit usingthe ADC.

In specific example embodiments of this disclosure, a constant currentsource, a stable time base and a capacitor may be used to self-checkoperation of an ADC by charging the capacitor for a pre-determinedamount of time to produce a voltage thereon. This voltage will beproportional to the amount of time that the capacitor was charged.Multiple points on the ADC transfer function can be verified in thisself-check procedure simply by varying the amount of time for chargingof the capacitor. Relative accuracy among test points may then be easilyobtained. Absolute accuracy may be obtained by using an accurate clockreference for the time base, a known current source and capacitor value.

A typical microcontroller has at least one ADC, an associated sample andhold (S/H) circuit that comprises a S/H capacitor and sampling switches.The microcontroller will also have timers, clock and constant currentsources available for use in a circuit for self-checking one or moreADC(s). Therefore, no external components or circuits are required forthe ADC self-test (check) procedure, according to specific exampleembodiments of this disclosure.

At the beginning of the ADC self-test procedure, the control logiccloses a switch across the ADC S/H capacitor to discharge it and thenopens the switch to allow the ADC S/H capacitor to be charged. Then aS/H charging switch may couple a constant current source to the S/Hcapacitor for a pre-determined time period. A tristate output of theconstant current source may be used instead of the S/H charging switch.A clock source, timer (used as a time base) and control logic may beused to close the S/H charging switch for the pre-determined timeperiod. The voltage on the S/H capacitor will be proportional to theperiod of time that the constant current source is coupled to the S/Hcapacitor. Once the time period is up, the S/H charging switch isopened, and the ADC can do an analog-to-digital conversion on thevoltage on the S/H capacitor. This process is repeated multiple times asthe charging time is varied. The ADC conversion sequences may beexamined for linear responses, which may then verify that the ADCconversions are working properly. Multiple analog voltage points may begenerated by just varying the time period used to charge the S/Hcapacitor to the specific analog voltage points. Then after theanalog-to-digital conversions are done, confirmation of correct ADCtransfer functions may be verified.

Referring now to the drawings, the details of example embodiments areschematically illustrated. Like elements in the drawings will berepresented by like numbers, and similar elements will be represented bylike numbers with a different lower-case letter suffix.

FIG. 1 illustrations a schematic block diagram for ADC self-test withoutuse of external references, according to embodiments of the presentdisclosure. A microcontroller 102 may comprise a clock 150, a timer 146,a control circuit 148, a microprocessor 144, a memory 142, ananalog-to-digital converter (ADC) 140, a sample and hold (S/H) capacitor130, a constant current source 120 that may have a tristate output, afirst switch 132, a second switch 134 and a multiplexer 152. All of theaforementioned circuits may be provided in the microcontroller 102. Thetimer 146 may be a counter that counts clock pulses from the clock 150and issues an action when a desired count is reached. The timer 146 maybe programmable for generating different time periods. Themicroprocessor 144 may program the count value into the timer 146.

The constant current source 120, providing a current I, may be coupledto the S/H capacitor 130 by enabling its tri-state output or with aswitch (not shown). The S/H capacitor 130, having a capacitance C, maybe charged for a predetermined time period t. The timer 146 and clock150 may be used to generate the time period t. C and I are constant,wherein:

${\Delta V}_{cap} = {\frac{I}{C}t}$

Therefore, the voltage on the S/H capacitor 130 is directly proportionalto the time period t in which the constant current source 120 is coupledto and charges the S/H capacitor 130. For providing a full-scale rangefor a 3 volt, 12-bit ADC, typical values for I, C and t may be, forexample but are not limited to, C=5 pF, I=1 μA and t=7.5 μs(microseconds) resulting in a voltage on the S/H capacitor 120 of 1.5volts. This provides a Δt=0.2 v/μs using C=5 pF and I=1 μA. For a 3 volt12-bit ADC, a one-bit resolution would require approximately 4 ns(nanoseconds)/bit. Therefore, depending on the clock speed and accuracythereof a self-test and linearity check of the ADC operation can beeasily performed using existing internal circuits of a typicalmicrocontroller and without requiring any external connections orcircuits.

A plurality of voltages having different values may be generated byusing different time periods. These plurality of voltages may beconverted to a plurality of digital representations thereof and storedin the memory 142. The plurality of digital representations may beprocessed with the microprocessor for determining accuracy and/orlinearity of the ADC conversion process.

Embodiments of the present disclosure may use a current source alreadyavailable on a die package, semiconductor device, microcontroller, orother suitable electronic device. Embodiments of the present disclosuremay easily check any point of the ADC transfer function. Relativelinearity checks may be performed to any desired resolution. Absoluteaccuracy checks depend on accuracy of the clock source and timerresolution.

The present invention has been described in terms of one or morepreferred embodiments, and it should be appreciated that manyequivalents, alternatives, variations, and modifications, aside fromthose expressly stated (e.g., methods of manufacturing, product byprocess, and so forth), are possible and within the scope of theinvention. It should be understood, however, that the description hereinof specific example embodiments is not intended to limit the disclosureto the particular forms disclosed herein.

What is claimed is:
 1. A method for self-testing an analog-to-digitalconverter (ADC), said method comprising the steps of: coupling aconstant current source to a discharged capacitor for a time period;converting a voltage on the capacitor after the time period to a digitalvalue with the ADC; comparing the digital value from the ADC to thevoltage on the capacitor represented by the equation V=I/C*t, where V isthe voltage on the capacitor, I is the constant current, C is thecapacitance of the capacitor and t is the time period.
 2. The methodaccording to claim 1, further comprising the steps of: a) setting thetime period to a minimum time; b) discharging the capacitor; c) couplingthe capacitor for the time period to the constant current source havinga current value I; d) converting the voltage on the capacitor to adigital value with the ADC after the time period ends; e) storing thedigital value of that time period in a memory; f) ending the testing ofthe ADC when the time period is equal to or greater than a maximum timethen going to step i); g) increasing the time period to a longer time;h) returning to step b); and i) determining ADC accuracy by evaluatingthe stored digital values.
 3. The method according to claim 2, whereinthe step of determining ADC linearity comprises the steps of comparingthe stored digital values with the respective time periods multiplied bythe current value I and divided by a capacitance C of the capacitor. 4.The method according to claim 2, further comprising the step ofevaluating the stored digital values to determine ADC linearity.
 5. Themethod according to claim 1, further comprising the steps of: a) settingthe time period to a maximum time; b) discharging the capacitor; c)coupling the capacitor for the time period to the constant currentsource having a current value I; d) converting the voltage on thecapacitor to a digital value with the ADC after the time period ends; e)storing the digital value of that time period in a memory; f) ending thetesting of the ADC when the time period is less than or equal to aminimum time then going to step i); g) decreasing the time period to ashorter time; h) returning to step b); and i) determining ADC accuracyby evaluating the stored digital values.
 6. The method according toclaim 5, wherein the step of determining ADC accuracy comprises thesteps of comparing the stored digital values with the respective timeperiods multiplied by the current value I and divided by a capacitance Cof the capacitor.
 7. The method according to claim 5, further comprisingthe step of evaluating the stored digital values to determine ADClinearity.
 8. An apparatus to self-test an analog-to-digital converter(ADC), comprising: a constant current source; a capacitor; a firstswitch operable to short out a charge on the capacitor; a second switchoperable to couple the constant current source to the capacitor; an ADChaving an input coupled to the capacitor; and a control circuit having atimer; wherein the control circuit closes the first switch therebyshorting out any charge on the capacitor, opens the first switch andcloses the second switch thereby coupling the constant current source tothe capacitor, and opens the second switch after a time perioddetermined by the timer; and a memory for storing a digitalrepresentation from an output of the ADC of a voltage on the capacitorafter the second switch opens.
 9. The apparatus according to claim 8,wherein the memory stores a plurality of digital representations ofrespective voltages on the capacitor generated by a plurality ofdifferent time periods.
 10. The apparatus according to claim 8, whereinthe second switch is a tri-state output of the constant current source.11. The apparatus according to claim 8, wherein the timer isprogrammable for generating different time periods.
 12. The apparatusaccording to claim 8, further comprising a high accuracy clock coupledto the timer for generating a precision time period.
 13. A system forself-testing an analog-to-digital converter (ADC), said systemcomprising: a clock; a control circuit having a timer and coupled to theclock; a microprocessor coupled to the control circuit; a memory coupledto the microprocessor; a constant current source; a capacitor; a firstswitch controlled by the control circuit and operable to short out acharge on the capacitor; a second switch controlled by the controlcircuit and operable to couple the constant current source to thecapacitor; and an ADC having an input coupled to the capacitor and anoutput coupled to the microprocessor; wherein the control circuit closesthe first switch thereby shorting out any charge on the capacitor, opensthe first switch and closes the second switch thereby coupling theconstant current source to the capacitor, and opens the second switchafter a time period determined by the timer; and the microprocessorstores in the memory a digital representation from the ADC of a voltageon the capacitor after the second switch opens.
 14. The system accordingto claim 13, wherein the second switch is a tri-state output of theconstant current source.
 15. The system according to claim 13, whereinthe system comprises a microcontroller.
 16. The system according toclaim 13, wherein the timer is programmable for generating differenttime periods.
 17. The system according to claim 13, wherein the clock isa high accuracy clock for generating a precision time period.